<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src='https://unpkg.com/@antv/l7'></script>
    <script src="https://unpkg.com/@antv/l7-draw"></script>
    <script src="https://lib.baomitu.com/jquery/2.2.4/jquery.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0
        }

        #map {
            width: 100vw;
            height: 100vh;
        }

        html,
        body {
            overflow: hidden;
        }
    </style>
</head>

<body>
    <div id="map">

    </div>
    <script>
        var { Scene, GaodeMap } = L7;
        const scene = new Scene({
            id: 'map',
            map: new GaodeMap({
                /* dark|light|normal */
                style: 'normal', // 样式URL
                center: [120.19382669582967, 30.258134],
                pitch: 50,
                zoom: 2,
                // token: '3851594382e218c49865a4d6a5170b52',
            }),
            logoVisible: false
        });

        // const { DrawEvent, DrawLine } = L7.Draw
        // scene.on('loaded', () => {
        //     const drawLine = new DrawLine(scene, {
        //         //展示距离
        //         distanceOptions: {},
        //     });
        //     drawLine.enable();

        //     drawLine.on(DrawEvent.Change, (allFeatures) => {
        //         console.log(allFeatures);
        //     });
        // });
        // const { DrawEvent, DrawPolygon } = L7.Draw
        // scene.on('loaded', () => {
        //     const drawPolygon = new DrawPolygon(scene, {
        //         //展示面积
        //         areaOptions: {},
        //     });
        //     drawPolygon.enable();

        //     drawPolygon.on(DrawEvent.Change, (allFeatures) => {
        //         console.log(allFeatures);
        //     });
        // });
        // const { DrawEvent, DrawRect } = L7.Draw
        // scene.on('loaded', () => {
        //     const drawRect = new DrawRect(scene, {});
        //     drawRect.enable();

        //     drawRect.on(DrawEvent.Change, (allFeatures) => {
        //         console.log(allFeatures);
        //     });
        // });
        const { DrawEvent, DrawCircle } = L7.Draw
        scene.on('loaded', () => {
            const drawCircle = new DrawCircle(scene, {});
            drawCircle.enable();

            drawCircle.on(DrawEvent.Change, (allFeatures) => {
                console.log(allFeatures);
            });
        });
    </script>
</body>

</html>